﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace DataInterpolator.Model
{
   public class Well_IsoData
   {
      public double IntervalVelocity
      {
         get; set;
      }

      public double IsoPach
      {
         get; set;
      }

      public double IsoTime
      {
         get; set;
      }

      public void Calc(Well_Tops topsData, string topFormTitle, string botFormTitle)
      {
         IntervalVelocity = 0.0;
         IsoPach = 0.0;
         IsoTime = 0.0;

         if (topsData == null)
            return;

         if (!topsData.Contains(topFormTitle))
            return;

         if (!topsData.Contains(botFormTitle))
            return;

         Well_Formation topForm = topsData[topFormTitle];
         Well_Formation botForm = topsData[botFormTitle];

         IsoPach = Math.Abs(topForm.Depth - botForm.Depth);
         IsoTime = Math.Abs(topForm.Time - botForm.Time);

         if (IsoTime != 0.0)
         {
            IntervalVelocity = 2.0 * Math.Abs(IsoPach / IsoTime);
         }
      }
   }
}
